load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")

cc_library(
    name = "boost.url",
    srcs = glob([
        "src/**/*.cpp",
        "src/**/*.hpp",
    ]),
    hdrs = glob(["include/**/*.hpp"]),
    includes = ["include"],
    local_defines = select({
        "@platforms//os:windows": ["BOOST_URL_NO_LIB=1"],
        "//conditions:default": [],
    }),
    visibility = ["//visibility:public"],
    deps = [
        "@boost.align",
        "@boost.assert",
        "@boost.config",
        "@boost.core",
        "@boost.mp11",
        "@boost.optional",
        "@boost.static_assert",
        "@boost.system",
        "@boost.throw_exception",
        "@boost.type_traits",
        "@boost.variant2",
    ],
)

cc_library(
    name = "boost.url_test_lib",
    testonly = True,
    srcs = [
        "extra/test_main.cpp",
        "extra/test_suite.hpp",
    ],
    includes = ["extra"],
    deps = [
        ":boost.url",
        "@boost.container",
        "@boost.filesystem",
    ],
)

cc_test(
    name = "boost.url_test",
    srcs = glob([
        "test/unit/*.cpp",
        "test/unit/*.hpp",
    ]),
    deps = [":boost.url_test_lib"],
)
